// 存放路径: src/services/home.ts
import { http } from '@/utils/http'

export const getPhoneImgTypes = () => {
    return http<any>({
        method: 'GET',
        url: 'http://service.aibizhi.adesk.com/v1/vertical/category?adult=false&first=1',
        data: {}
    })
}
export const getPhoneImgAll = (params: any) => {
    return http<any>({
        method: 'GET',
        url: `http://service.picasso.adesk.com/v1/vertical/vertical`,
        data: {
            limit: params.limit,
            adult: params.adult,
            first: 1,
            order: params.order,
            skip: params.skip
        }
    })
}
export const getPhoneImgList = (params: any) => {
    return http<any>({
        method: 'GET',
        url: `http://service.aibizhi.adesk.com/v1/vertical/category/${params.id}/vertical`,
        data: {
            limit: params.limit,
            adult: params.adult,
            first: 1,
            order: params.order,
            skip: params.skip
        }
    })
}
// 获取涩图
export const getSetu = (data: any): any => {
    return http<any>({
        method: 'POST',
        url: `https://setu.yuban10703.xyz/setu`,
        data
    })
}

// 获取pexels图片
export const getPexelsImgs = (params: any): any => http({
    url: 'https://api.pexels.com/v1/curated',
    method: 'GET',
    header: {
        Authorization: 'be2SiQjrbTEIzyAu6dpSovjCPvyNNVek1omoAguYfRJC7hWMpwHZTz98'
    },
    data: {
        page: params.page,
        per_page: params.limit
    }
})

// 获取 萌える嘘 图片
export const getMoeImg = (data: any): any => http({
    url: 'https://imgapi.lie.moe/random',
    method: 'GET',
    data
})


export const getImgsAPI = (params: any) => http({
    method: 'GET',
    url: 'https://img.moehu.org/pic.php',
    data: {
        return: 'json',
        id: params.id,
        num: params.num,
        size: params.size,
        //添加随机数，防止出现缓存
        random: Math.random()
    }
})
